var mongodb = require('mongodb');

var client = new mongodb.Db('myrpg', new mongodb.Server("127.0.0.1", 27017, {}));

var classes = null;

client.open(function(err, p_client) {
    if(err)
        console.warn(err.message);
    else{
        p_client.collection('classes', function (err, collection) {
            classes = collection;
        });
    }  
});

exports.getAll = function(callback){
    classes.find().toArray(callback);
};